/* ========================================================================== */
/* 1. RESET & BASE (STYLES GLOBAUX) */
/* ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    background-color: #f7f5ff;
    color: #000000;
    /* Par défaut (Homepage) : écran bloqué, pas de scroll */
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 64px;
}

/* ========================================================================== */
/* 2. NAVIGATION PRINCIPALE (MENU HAUT) */
/* ========================================================================== */
.navbar {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Style des boutons liens globaux */
a {
    color: #000000;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 16px;
    border: 1px solid #000000;
    background-color: #DDFF00;
    padding: 4px 8px;
    display: inline-block;
    transition: background-color 0.2s, color 0.2s;
}

a:hover {
    color: #DDFF00;
    background-color: #000000;
}

/* ========================================================================== */
/* 3. COMPOSANTS DE TITRES & TEXTES */
/* ========================================================================== */
h1 {
    font-family: Impact, sans-serif;
    font-size: 80px;
    font-weight: 400;
    line-height: 0.9;
}

h2 {
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}

.encadre {
    border: 1px solid #000000;
    background-color: #DDFF00;
    padding: 2px 6px;
    display: inline-block;
    width: fit-content;
    margin: 0;
}

.encadre-titre {
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #000;
    background-color: #DDFF00;
    padding: 4px 8px;
    display: inline-block;
    margin-bottom: 16px;
}

.rainbow-bg {
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    color: #000;
}

/* ========================================================================== */
/* 4. HOMEPAGE SPECIFIQUE (GALERIE & DRAG) */
/* ========================================================================== */
.header-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex-shrink: 0;
}

.meme-gallery {
    position: relative;
    height: 65vh; /* Zone centrale */
    width: 100%;
    max-width: none;
    margin: auto 0; /* Centrage vertical */
    overflow: visible;
}

.draggable {
    position: absolute;
    cursor: grab;
    user-select: none;
    border: none;
    z-index: 1;
    
    /* Animation vibration constante */
    animation: micro-shake 3s ease-in-out infinite;
    
    /* Retour lent à la position d'origine (4s) */
    transition: top 4s cubic-bezier(0.2, 1, 0.3, 1), 
                left 4s cubic-bezier(0.2, 1, 0.3, 1),
                transform 0.3s;
}

.draggable:active, .is-dragging { 
    cursor: grabbing; 
    animation: none !important;
    transition: none !important;
    transform: scale(1.05); 
}

/* Vibrations désynchronisées */
.draggable:nth-child(odd) { animation-duration: 3.5s; animation-delay: 0.1s; }
.draggable:nth-child(even) { animation-duration: 2.8s; animation-delay: 0.4s; }

@keyframes micro-shake {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(0.5px, 0.5px); }
    50%  { transform: translate(0, 1px); }
    75%  { transform: translate(-0.5px, 0.5px); }
    100% { transform: translate(0, 0); }
}

/* ========================================================================== */
/* 5. PAGES FILLES (INTRODUCTION & ARTICLES) */
/* ========================================================================== */

/* Override du body pour permettre le scroll sur les pages longues */
.page-fille {
    display: block; 
    overflow-y: auto; 
    min-height: 100vh;
    scroll-behavior: smooth; /* Défilement fluide pour les ancres */
}

/* Layout global 2 colonnes */
.main-layout {
    display: flex;
    flex-direction: row;
    gap: 80px; 
    margin-top: 32px;
    padding-bottom: 64px;
    
    /* IMPORTANT pour le Sticky : alignement en haut */
    align-items: flex-start; 
}

/* --- COLONNE GAUCHE (TITRES & NAVIGATION) --- */
.col-titre {
    flex: 0 0 auto;
    /* Sticky position : suit le scroll */
    position: sticky;
    position: -webkit-sticky;
    top: 32px; 
}

.col-titre h1 {
    display: inline-block;
    white-space: nowrap;
}

.titre-page {
    font-size: 50px; 
    line-height: 1;
    display: inline-block;
    width: fit-content;
}

/* Sous-menu (boutons gris/jaune) */
.sub-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
}

.btn-sub {
    font-size: 14px;
    font-family: Arial, sans-serif;
    text-decoration: none;
    color: #000;
    border: 1px solid #000;
    padding: 6px 12px;
    background-color: #FFFFFF; /* Blanc par défaut */
    transition: background-color 0.3s ease;
}

.btn-sub:hover {
    background-color: #f0f0f0;
}

.btn-sub.active {
    background-color: #DDFF00; /* Jaune quand actif */
}

/* --- COLONNE DROITE (CONTENU) --- */
.col-contenu {
    flex: 1;
    max-width: 800px; /* Largeur de lecture max */
}

/* Sections d'articles */
.article-section {
    display: flex;
    flex-direction: row;
    justify-content: flex-end; /* Texte aligné à droite du bloc */
    gap: 32px;
    margin-bottom: 64px;
    
    /* Marge pour que le titre ne soit pas caché lors du scroll */
    scroll-margin-top: 32px; 
}

/* Boîte de texte (Intro & Articles) */
.boite-texte {
    border: 1px solid #000000;
    padding: 32px;
    background-color: transparent; 
}

.text-col {
    flex: 1;
    max-width: 800px;
}

.boite-texte p {
    font-family: Arial, sans-serif;
    font-size: 14px; 
    line-height: 1.5;
    margin-bottom: 16px;
    text-align: justify; 
}

.boite-texte em { font-style: italic; }

/* Notes de bas de page */
.footnotes {
    margin-top: 32px;
    padding-top: 16px;
}

.footnotes p {
    font-size: 10px; 
    margin-bottom: 4px;
    color: #000;
}

/* Flèches de navigation bas de page */
.navigation-bottom {
    display: flex;
    justify-content: flex-end; 
    margin-top: 16px;
}

.btn-arrow {
    font-size: 20px;
    padding: 4px 12px;
}

/* ========================================================================== */
/* 6. ELEMENTS VISUELS SPECIFIQUES */
/* ========================================================================== */
/* Style Polaroid (si tu remets les images plus tard) */
.polaroid {
    background-color: #000;
    padding: 10px 10px 0 10px;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.polaroid img {
    border: 2px solid #fff;
    margin-bottom: 8px;
}

.polaroid-caption {
    color: #fff;
    font-family: "Times New Roman", serif;
    text-transform: uppercase;
    font-size: 18px;
    padding-bottom: 10px;
    line-height: 1.1;
}

/* ========================================================================== */
/* 7. FOOTER */
/* ========================================================================== */
.footer-info-container {
    position: relative; 
    z-index: 9999;
    margin-top: auto; 
    align-self: flex-end; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end;
}

.texte-encadre-italic {
    font-style: italic; 
    text-align: right; 
    border: 1px solid #000000;
    background-color: #DDFF00; 
    padding: 8px; 
    display: inline-block; 
}

/* ========================================================================== */
/* 8. RESPONSIVE (MOBILE & TABLETTE) */
/* ========================================================================== */

/* --- Tablette / Laptop moyen (max 1024px) --- */
@media (max-width: 1024px) {
    body {
        padding: 32px; 
    }
}

/* --- Mobile / Petit écran (max 900px) --- */
@media (max-width: 900px) {
    /* Bascule la mise en page titre/texte en colonne */
    .main-layout {
        flex-direction: column; 
        gap: 32px;
    }
    
    .titre-page {
        font-size: 40px;
    }

    .boite-texte {
        padding: 16px;
    }
    
    /* Le sticky n'est pas nécessaire/souhaitable si tout est empilé */
    .col-titre {
        position: static;
        width: 100%;
    }

    .article-section {
        flex-direction: column;
    }
}

/* --- Mobile strict (max 768px) --- */
@media (max-width: 768px) {
    body {
        padding: 16px; 
    }
    
    h1.encadre { font-size: 40px; }
    
    .footer-info-container { 
        align-self: flex-start; 
        align-items: flex-start; 
    }
    
    .texte-encadre-italic { text-align: left; }
    
    .draggable { 
        transform: scale(0.6); 
        transform-origin: center; 
    }
}